package org.jeecg.modules.innerApi.zhiYunSdApi.util;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.*;

import java.io.Serializable;

/**
 * @description: 数电返回对象
 * @author: niugeng
 * @create: 2023-08-30
 **/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class ShudianResponse<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 成功 ：200   失败 ：99
     */
    @JSONField(name ="code")
    private int code;

    /**
     * 异常信息
     */
    @JSONField(name ="msg")
    private String msg;

    @JSONField(name ="data")
    private T data;


    /**
     * 是否成功
     *
     * @return boolean
     */
    public boolean isSuccess(){
        return "200".equals(this.code);
    }
}
